package show.hkl.remote.math;

import java.math.BigDecimal;
import java.math.BigInteger;

/**
 * 等比数列生成
 */
public class GeometricSequence {

    public static void main(String[] args) {
//        int q = 3;
//        int a1 = 4;
//        System.out.print("a1=" + a1 + "; ");
//        int sum = 0;
//        for (int i = 1; i <= 4; i++) {
//            System.out.print("a" + (i + 1) + "=" + a1 * q + "; ");
//            sum = sum + a1 * q;
//            q = q * q;
//        }
//        System.out.println("sum = " + sum);

        BigDecimal divide = BigDecimal.valueOf(1000).divide(BigDecimal.valueOf(128));
        BigInteger bigInteger = divide.toBigInteger();
        System.out.println(divide);
        System.out.println(bigInteger);
        int i = bigInteger.intValue();
        System.out.println(i);

    }

}
